Class: RPM::File

Inherits:
Object
  • Object
show all
Defined in:
ext/rpm/file.c

Instance Method Summary (collapse)

Constructor Details

- (Object) initialize

Instance Method Details

- (Object) attr

- (Boolean) config?

True if the file is marked as a configuration file

Returns:

  • (Boolean)

    True if the file is marked as a configuration file



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_config(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_CONFIG) ? Qtrue : Qfalse;
}

- (Boolean) doc?

True if the file is marked as documentation

Returns:

  • (Boolean)

    True if the file is marked as documentation



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_doc(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_DOC) ? Qtrue : Qfalse;
}

- (Boolean) donotuse?

True if the file is marked as do not use

Returns:

  • (Boolean)

    True if the file is marked as do not use



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_donotuse(VALUE file)
{
#if RPM_VERSION_CODE < RPM_VERSION(4,1,0)
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_DONOTUSE) ? Qtrue : Qfalse;
#else
    return Qfalse;
#endif
}

- (Boolean) exclude?

True if the file is listed in the exlude section

Returns:

  • (Boolean)

    True if the file is listed in the exlude section



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_exclude(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_EXCLUDE) ? Qtrue : Qfalse;
}

- (Boolean) ghost?

This flag indicates the file should not be included in the package. It can be used to name the needed attributes for a file that the program, when installed,

will create.

For example, you may want to ensure that a program???s log file has certain attributes.

Returns:

  • (Boolean)

    True if the file is marked as ghost



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_ghost(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_GHOST) ? Qtrue : Qfalse;
}

- (String) group

Group that owns the file. Nil may be returned.

Returns:

  • (String)

    Group that owns the file. Nil may be returned.



# File 'ext/rpm/file.c'

VALUE
rpm_file_get_group(VALUE file)
{
    return rb_ivar_get(file, id_group);
}

- (Boolean) license?

True if the file is a license

Returns:

  • (Boolean)

    True if the file is a license



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_license(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_LICENSE) ? Qtrue : Qfalse;
}
Note:

This path is sometimes relative. To convert an absolute path from relative path: File.expand_path (file.link_to, File.dirname (file.path))

Path to the destination if the file is a symbolic link

Returns:

  • (String)

    Path to the destination if the file is a symbolic link



# File 'ext/rpm/file.c'

VALUE
rpm_file_get_link_to(VALUE file)
{
    return rb_ivar_get(file, id_link_to);
}

- (String) md5sum

Md5sum as string

Returns:

  • (String)

    md5sum as string



# File 'ext/rpm/file.c'

VALUE
rpm_file_get_md5sum(VALUE file)
{
    return rb_ivar_get(file, id_md5sum);
}

- (Boolean) missingok?

This modifier is used for files or links that are created during the %post scripts

but will need to be removed if the package is removed

Returns:

  • (Boolean)

    True if the file is marked that can be missing on disk



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_missingok(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_MISSINGOK) ? Qtrue : Qfalse;
}

- (Number) mode

File permissions

Returns:

  • (Number)

    File permissions



# File 'ext/rpm/file.c'

VALUE
rpm_file_get_mode(VALUE file)
{
    return rb_ivar_get(file, id_mode);
}

- (Time) mtime

File modification time.

Returns:

  • (Time)

    File modification time.



# File 'ext/rpm/file.c'

VALUE
rpm_file_get_mtime(VALUE file)
{
    return rb_ivar_get(file, id_mtime);
}

- (Boolean) netshared?

True if the file is shared over the network

Returns:

  • (Boolean)

    True if the file is shared over the network



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_netshared(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_state))
            == RPMFILE_STATE_NETSHARED) ? Qtrue : Qfalse;
}

- (Boolean) noreplace?

This flag is used to protect local modifications. If used, the file will not overwrite an existing file that has been modified. If the file has not been modified on disk, the rpm command will overwrite the file. But,

if the file has been modified on disk, the rpm command will copy the new file with an extra
file-name extension of .rpmnew.

Returns:

  • (Boolean)

    True if the file is marked as configuration not to be replaced



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_noreplace(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_NOREPLACE) ? Qtrue : Qfalse;
}

- (Boolean) notinstalled?

True if the file is not installed

Returns:

  • (Boolean)

    True if the file is not installed



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_notinstalled(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_state))
            == RPMFILE_STATE_NOTINSTALLED) ? Qtrue : Qfalse;
}

- (String) owner

File owner. Nil may be returned.

Returns:

  • (String)

    File owner. Nil may be returned.



# File 'ext/rpm/file.c'

VALUE
rpm_file_get_owner(VALUE file)
{
    return rb_ivar_get(file, id_owner);
}

- (String) path

File path

Returns:

  • (String)

    file path



# File 'ext/rpm/file.c'

VALUE
rpm_file_get_path(VALUE file)
{
    return rb_ivar_get(file, id_path);
}

- (Number) rdev

Device type of the file

Returns:

  • (Number)

    Device type of the file



# File 'ext/rpm/file.c'

VALUE
rpm_file_get_rdev(VALUE file)
{
    return rb_ivar_get(file, id_rdev);
}

- (Boolean) readme?

True if the file is a README

Returns:

  • (Boolean)

    True if the file is a README



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_readme(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_README) ? Qtrue : Qfalse;
}

- (Boolean) replaced?

True if the file is replaced during installation

Returns:

  • (Boolean)

    True if the file is replaced during installation



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_replaced(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_state))
            == RPMFILE_STATE_REPLACED) ? Qtrue : Qfalse;
}

- (Number) size

File size

Returns:

  • (Number)

    File size



# File 'ext/rpm/file.c'

VALUE
rpm_file_get_size(VALUE file)
{
    return rb_ivar_get(file, id_size);
}

- (Boolean) specfile?

True if the file is marked as a spec file

Returns:

  • (Boolean)

    True if the file is marked as a spec file



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_specfile(VALUE file)
{
    return (NUM2INT(rb_ivar_get(file, id_attr)) & RPMFILE_SPECFILE) ? Qtrue : Qfalse;
}

- (Object) state

- (Boolean) symlink?

True if the file is a symbolic link

Returns:

  • (Boolean)

    True if the file is a symbolic link



# File 'ext/rpm/file.c'

VALUE
rpm_file_is_symlink(VALUE file)
{
    return NIL_P(rb_ivar_get(file, id_link_to)) ? Qfalse : Qtrue;
}